import {createApp} from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import App from './App.vue'
import router from './router'
import './router/permission.js'
import SvgIcon from '@/components/svgicon/index.vue';
import 'virtual:svg-icons-register';

const app = createApp(App)
const pinia = createPinia()

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

pinia.use(piniaPluginPersistedstate)

app.component('svg-icon', SvgIcon);

app.use(pinia)
app.use(router)

app.mount('#app')
